import {
  ProFormColumnsType,
  ProFormProps,
  DrawerFormProps,
  LightFilterProps,
  ModalFormProps,
  QueryFilterProps,
  StepFormProps,
  StepsFormProps,
} from '@ant-design/pro-components';
import React, { JSX } from 'react';
import { FormProps } from 'antd';

declare type ProFormPropsType<T, ValueType = 'text'> =
  | ((
      | ({
          layoutType?: 'Form';
        } & ProFormProps<T>)
      | ({
          layoutType: 'DrawerForm';
        } & DrawerFormProps<T>)
      | ({
          layoutType: 'ModalForm';
        } & ModalFormProps<T>)
      | ({
          layoutType: 'QueryFilter';
        } & QueryFilterProps<T>)
      | ({
          layoutType: 'LightFilter';
        } & LightFilterProps<T>)
      | ({
          layoutType: 'StepForm';
        } & StepFormProps<T>)
      | {
          layoutType: 'Embed';
        }
    ) & {
      columns: ProFormColumnsType<T, ValueType>[];
    })
  | ({
      layoutType: 'StepsForm';
      columns: ProFormColumnsType<T, ValueType>[][];
    } & StepsFormProps<T>);

interface Props {
  layoutType?: ProFormPropsType<string>;
}

declare function WitForm<T, ValueType = 'text'>(
  props: Omit<FormProps<T>, 'onFinish'> &
    ProFormPropsType<T, ValueType> &
    Props & {
      children?: React.ReactNode | React.ReactNode[];
    },
): JSX.Element;
// declare namespace WitForm {}

export { WitForm };
